home *** CD-ROM | disk | FTP | other *** search
/ DEFCON 14 / DEFCON_14_CD-ROM_2006.iso / DC-14-Presentations / DC-14-Conti / conti- firefox_forms.pl next >
Text File  |  2006-07-06  |  1KB  |  50 lines

  1. # This program is a proof of concept script to show
  2. # you what type of information you've been disclosing
  3. # via your web searches.  It is designed to extract
  4. # the cached values in your Firefox form cache.  
  5. #
  6. # *nix usage:  cat formhistory.dat | perl firefox_forms.pl
  7. # windows usage:  type formhistory.dat | perl firefox_forms.pl
  8. #
  9. # formhistory.dat is the Firefox form data cache.  You should
  10. # make a copy of it before you attempt the above.
  11. #
  12. # Directions for finding formhistory.dat on your platform are here...
  13. # http://kb.mozillazine.org/Profile_folder#Firefox
  14. #
  15. # I am releasing this program under the GNU Public License.
  16. # see http://www.gnu.org/copyleft/gpl.html 
  17. #
  18. # The Firefox form cache is in the Mork file format
  19. # see http://en.wikipedia.org/wiki/Mork_(file_format)
  20. #
  21. # Greg Conti
  22. # http://www.rumint.org/gregconti/index.html
  23. # May 2006
  24.  
  25.  
  26.  
  27. #! /usr/bin/perl
  28.  
  29. $lines=0; #used to count the number of cached form field values
  30.  
  31. @file = <STDIN>;  #load the entire file into an array
  32.  
  33. foreach $line (@file) {
  34.   $_ = $line;
  35.   s/\$00//g;  #remove $00's from file
  36.   s/\\\n//g;  #remove newline from mulit-lines lines
  37.   s/\)/\)\n/g; #add a newline after each entry   
  38.   
  39.   if (/\=.*\)/){ #match each entry     
  40.     $_ = $&; #store matching value
  41.     s/\=//g; #remove leading = 
  42.     s/\)//g; #remove trailing )
  43.     print "$_\n";           
  44.     $lines++;
  45.   }
  46. }
  47. print "Number of cached values = ".$lines;
  48.   
  49.   
  50.